<template>
	<view class="header">
		<view class="saoma" @click="scanCode">
			<text class="iconfont  iconrichscan_icon"></text>
		</view>
		<view class="search_bar">
			<uni-search-bar :radius="radius" :placeholder="SearchPlaceHolder" @confirm="search"></uni-search-bar>
		</view>
		<view class="share">
			<text class="iconfont iconfenxiang"></text>
		</view>
	</view>
</template>

<script>
	import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
	export default {
		data() {
			return {
				searchValue: "",
				radius: 100,
				SearchPlaceHolder: "口罩",
			}
		},
		components: {
			uniSearchBar
		},
		methods: {
			// 点击搜索
			search( e ) {
				// console.log(e);
				this.searchValue = e.value
			},
			// 点击扫码
			scanCode() {
				uni.scanCode({
					scanType:"qrCode",
					success( res ) {
						console.log(res);
					}
				})
			},
		},
	}
</script>

<style scoped lang="scss">
	.header {
		width: 100%;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		height: 100rpx;
		overflow: hidden;
		position: fixed;
		left: 0;
		top: 0;
		background-color: #fff;
		.saoma {
			width: 100rpx;
			text-align: center;
			
			text {
				display: block;
				font-size: 40rpx;
			}
		}
		.search_bar {
			flex: 1;
			
		}
		.share {
			width: 100rpx;
			text-align: center;
			text {
				display: block;
				font-size: 40rpx;
			}
		}
	}
	
</style>

<style>
	.uni-searchbar{
		background-color: none !important;
	}
</style>
